<% @page_title = "Update Your Photo" %>

<%= render :partial => 'users/menu' %>

<div class="form_container column span-16 prepend-3 last">

  <h3><%= @page_title %></h3>

  <%= sourdough_error_messages_for :photo %>
  <%= sourdough_error_messages_for :user %>
  <% form_for(:photo, :url => user_photos_path(@user), :html => { :multipart => true }) do |f| -%>
    <% if @user.photo && @photo.errors.blank? && @user.errors.blank? %>
      <dl class="inline">
        <dt style="height:75px;">
            <label for="email">
                Current Photo: <p class="delete"><%= link_to 'delete', user_photos_path(current_user), :confirm => 'Are you sure?', :method => :delete %></p>
            </label>
        </dt>
        <dd>
            <%= avatar_for(@user) %>
        </dd>
      </dl>
    <% end %>
    <dl class="inline">
      <dt><%= label_for :user, 'Upload New Photo' %></dt>
      <dd><%= f.file_field :uploaded_data %></dd>
    </dl>
    <hr />
    <p><%= submit_tag "Update Your Photo", :class => "submit" %></p>
  <% end %>

</div>
